package com.mashibing.dp.factorymethod;

// 司机
public class Main {
    public static void main(String[] args) {
        // 1、任意定制交通工具：继承Moveable
        Moveable m2 = new Plane();
        m2.go();
        Moveable m3 = new Broom();// 可以把这个类名放配置文件里，这个方法就不用变了
        m3.go();
        SimpleVehicleFactory simpleVehicleFactory = new SimpleVehicleFactory();
        Car m4 = simpleVehicleFactory.createCar();
        // 2、任意定制生产过程：Moveable XXXFactory.create()

        // 要求控制权限，飞机汽车的权限都一样的，
        Moveable m = new CarFactory().create();
        m.go();
        // 工厂方法
        VehicleFactory cf = new PlaneFactory();
        Moveable m5 = cf.create();
        m5.go();
    }
}
